#include<bits/stdc++.h>
using namespace std;
int main(){
	freopen("charcom.in" , "r" , stdin);
	freopen("charcom.out" , "w" , stdout);
	int n , k;
	cin >> n >> k;
	int m = (1 << n) - 1;
	int i = 0 , l = 1 , r = m;
	while(k >= l && k <= r){
		int mid = (l + r) / 2;
		if(k <= mid){
			cout << char('A' + i);
			l = l + 1;
			r = mid;
		} 
		else{
			l = mid + 1;
		}
		i++;
	}
	return 0;
}
